#define _CRT_SECURE_NO_WARNINGS 1
int removeDuplicates(int* nums, int numsSize) {
    int i = 0;
    int j = 1;
    int dest = 0;
    while (j < numsSize)
    {
        if (nums[i] != nums[j])
        {
            nums[dest] = nums[i];
            dest++;
            i = j;
            j++;
        }
        else
        {
            j++;
        }
    }
    nums[dest++] = nums[i];
    return dest;
}